
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.Map,java.util.Map.Entry,java.util.HashMap,java.util.Set,java.util.Map,java.util.HashMap,java.util.List,java.sql.Connection,com.java1234.util.DbUtil,com.java1234.dao.carDao,com.java1234.dao.animalDao,java.util.ArrayList,com.java1234.model.car"%> 
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>购物车列表</title>
<style type="text/css">
	html{
	height:100%;
	background-image:url("images/gouwuche.jpg"),url("images/managerin.jpg")	;
	background-repeat:no-repeat,repeat;
	background-attachment:fixed,fixed;
	background-position:center,left top; 
	}
	.form{
	width:400px;
	height:300px;
	margin:0 auto;
	margin-top:300px;
	}.submit{
	margin-top:30px;
	width:100px;
	}
</style>
</head>
<body>
		您的购物车商品列表：<br>
<%
		List<car> car = new ArrayList<car>();
		String username=(String)session.getAttribute("username");
		Connection con=null;
		DbUtil dbUtil=new DbUtil();
		carDao cardao = new carDao();
		animalDao animaldao = new animalDao();
		try {
			con=dbUtil.getCon();
			car=cardao.find(con, username);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		};
		int sum = 0;
		if(null!=car){
			%><a href="userfind.jsp">点击此处返回操作界面</a>
			<table border="1">
				<tr><th>宠物ID</th><th>价格</th></tr>
				<%
				
					try{
						for(car animal2:car)
						{
							%><tr><th><%=animal2.getId() %></th><th><%=animal2.getPrice() %></th>	
							<th><a href="carde.jsp?&ID=<%=animal2.getId()%>">从购物车中删除</a></th>						
						<%
						sum += animal2.getPrice();
						}
					}catch(Exception e){
						
					}
				%>
			</table>
			<% 
		}
		%>
		共<%=sum %>元
		&nbsp<a href="clean.jsp">结算</a>
</body>
</html>